sub infix:<cmp>

Documentation for sub infix:<cmp> assembled from the following types:

class Range

From Range

(Range) sub infix:<cmp>

multi sub infix:<cmp>(Range:D \aRange:D \b --> Order:D)
multi sub infix:<cmp>(Num(Real) \aRange:D \b --> Order:D)
multi sub infix:<cmp>(Range:D \aNum(Real) \b --> Order:D)
multi sub infix:<cmp>(Positional \aRange:D \b --> Order:D)
multi sub infix:<cmp>(Range:D \aPositional \b --> Order:D)

Compares two Range objects. A Real operand will be considered as both the starting point and the ending point of a Range to be compared with the other operand. A Positional operand will be compared with the list returned by the .list method applied to the other operand. See List infix:<cmp>

say (1..2cmp (1..2); # OUTPUT: «Same␤» 
say (1..2cmp (1..3); # OUTPUT: «Less␤» 
say (1..4cmp (1..3); # OUTPUT: «More␤» 
say (1..2cmp 3;      # OUTPUT: «Less␤» 
say (1..2cmp [1,2];  # OUTPUT: «Same␤»

class DateTime

From DateTime

(DateTime) sub infix:<cmp>

multi sub infix:<cmp>(DateTime:D \aDateTime:D \b --> Order:D)

Compares the equivalent instant, returns the Order.